import {
    http4
} from "@/service/axios";

// 菜单列表
export function getMenuList(data) {
    return http4.get({
        url: '/user/menu/list',
        params: data
    })
}

// 菜单列表（下拉框）接口 
export function getMenuTree() {
    return http4.get({
        url: '/user/menu/tree?onlyParent=1'
    })
}

// 菜单新增
export function getMenuAdd(data) {
    return http4.post({
        url: '/user/menu/add',
        data
    })
}

// 获取菜单表单接口
export function getMenuFormApi(id) {
    return http4.get({
        url:`/user/menu/form/${id}`
    })
}

// 菜单编辑
export function getMenuEdit({
    id,
    data
}) {
    return http4.put({
        url: `/user/menu/edit/${id}`,
        data
    })
}

// 上传图片
export function getUpload(data) {
    return http3.post({
        url: "/file/upload",
        data,
    });
}

// 菜单状态编辑
export function getStatusAPi({
    id,
    status
}) {
    return http4.put({
        url: `/user/menu/${status}/${id}`
    })
}